package com.hardydou.system.service;


import com.hardydou.system.model.SystemUser;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

public interface ISystemUserService {

    @Transactional
    SystemUser addUser(SystemUser user);

    @Transactional
    void deleteByUserId(long userId);

    @Transactional
    SystemUser update(SystemUser user);


    List<SystemUser> list(Map<String, Object> params);

    SystemUser findByUsername(String username);

    SystemUser findByUserId(Long userId);

    /***
     * 批量获取用户基本信息（账号、头像、用户ID）
     * @param uids
     * @return
     */
    List<Map> simpleInfo(List<Long> uids);


    /***
     * 为用户授权角色
     * @param userId
     * @param roleIds
     */

    @Transactional
    void authRole(long userId, long[] roleIds);
}
